
<!DOCTYPE html>
<html>

<head>
   
    
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!--360浏览器优先以webkit内核解析-->


<title>非常规促销常用模板管理</title>

<link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
<link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="__STATIC__/layout/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
<link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
<link href="__STATIC__/layout/css/channel.css?v=4.1.0" rel="stylesheet">
<!-- Sweet Alert -->
<link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
   
</head>

<body class="white-bg" style="padding: 3px;">
    <div class="page-heade">
       <h2 class="title_color text-center">非常规促销常用模板管理</h2>
    </div>
    <form action="" class="form-inline" id="form1">
        <table class="table table-bordered bud_hei">
            <tr class="info">
                <td style="width: 10%" class="text-center">
                    <a class="btn btn-sm btn-primary add_ftemplate" href="javascript:;">添加新模板</a>
                </td>
                <td></td>
            </tr>
            <tr>
                <td colspan="2">模糊查询：模糊名称 <input type="text" name="" class="form-control"> <button class="btn btn-sm btn-info">查询</button><span class="lr_5"></span><button class="btn btn-sm btn-info">清空查询条件</button></td>
            </tr>
        </table>
    </form>
    <table class="table table-striped table-bordered table-hover bud_hei text-center aprovalSystemTable" style="width: 100%;">
        <tr class="info">
            <th class="text-center">No.</th>
            <th class="text-center">标题</th>
            <th class="text-center">作者</th>
            <th class="text-center">时间</th>
            <th class="text-center">是否公用模板</th>
            <th class="text-center">是否常用模板</th>
            <th class="text-center">维护</th>
        </tr>
        <tbody>
            <tr>
                <td>1</td>
                <td class="text-left">杭州乐购丽昂分店促销活动2017年4月</td>
                <td>张三</td>
                <td>2016-06-24</td>
                <td>是</td>
                <td>是</td>
                <td><a  href="javascript:;" class="modify">修改</a>&nbsp;<a href="javascript:;" class="del_this">删除</a>&nbsp;<a href="javascript:;" class="setFormal">设置为常用模板</a></td>
            </tr>
            <tr>
            <td>2</td>
            <td class="text-left">杭州乐购丽昂分店促销活动2017年4月</td>

                <td>张三</td>
                <td>2016-06-24</td>
                <td>是</td>
                <td>否</td>
                <td><a  href="javascript:;" class="modify">修改</a>&nbsp;<a href="javascript:;" class="del_this">删除</a>&nbsp;<a href="javascript:;" class="setFormal">设置为常用模板</a></td>
            </tr>
    </tbody>
    </table>
    <h5 class="text-center"  style="font-size: 13px;font-weight: 500">
                    总共有12条记录，第1/2页,当前页<input id="page" type="text"  style="width: 40px" value="1"/><span id="gopage">Go</span>&nbsp;&nbsp;<span id="fistpage">首页</span>&nbsp;&nbsp;
                    每页显示
                    <select id="pagesize">
                        <option value='10' selected>10条</option>
                        <option value='15'>15条</option>
                        <option value='20'>20条</option>

                    </select>
                </h5>


<!-- 全局js -->
<script src="__STATIC__/layout/js/jquery.min.js"></script>
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
<script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<!-- Sweet alert -->
<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
    $(function () {
        $('body').on('click','input[type=text]',function () {
            this.select()
        })
    })
</script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
    $(document).ready(function () {

/*添加模板*/
          $(".add_ftemplate").click(function () {
             layer.open({
                type: 2,
                title: '添加新模板',
                 area: ['1200px', '600px'],
                fixed: false, //不固定
                maxmin: true,
                content: "{:url('Other/add_nftemplate')}"
            });
            return false

        });
/*修改模板*/
          $(".modify").click(function () {
             layer.open({
                type: 2,
                title: '修改模板',
                 area: ['1200px', '600px'],
                fixed: false, //不固定
                maxmin: true,
                content: "{:url('Other/add_nftemplate')}"
            });
            return false

        });

        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })
        //删除
        $('.shanchu').click(function () {
            var link = $(this).attr('href')
            swal({
                title: "您确定要删除这条信息吗",
                text: "删除后将无法恢复，请谨慎操作！",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "删除",
                closeOnConfirm: false
            }, function (isConfirm) {
                if(isConfirm){
                    $.ajax({
                        'type':'post',
                        'url':link,
                        'dataType':'json',
                        'success':function (data) {
                            if(data.success){
                                location.reload()
                            }else
                                swal(data.msg, "", "error");
                        }
                    })
                }

            });
            return false
        });
    })
    $(document).on("click",".del_this",function() {
      
                swal({
                            title: "提示",
                            text: "您真的要删除么？",
                            type: "warning",
                            showCancelButton: true,
                            confirmButtonColor: "#FF3333",
                            confirmButtonText: "确定",
                            cancelButtonText: "取消",
                            closeOnConfirm: true
                        })
                        // function (isConfirm) {
                        //   if (isConfirm) {
                        //    //alert(cid);
                        //     $.post("{:url('Productsseries/dropser')}",{sid:sid},function(re){
                        //       //alert(re);
                        //         if(re==1){
                        //             swal({
                        //             title: "完成",
                        //             text:  "系列已删除",
                        //             type: "success"
                        //             },function(){
                        //                 location.href='{:url("Productsseries/series")}';
                                        
                        //             });
                        //         }else{
                        //              swal({
                        //             title: "错误",
                        //             text:  "系统繁忙请稍后再试",
                        //             type: "warning"
                        //             });
                        //         }
                        //     })
                        // }
                        // })
        });
/*设置为常用或是普通模板*/
var $setFormalText =$(".setFormal").text();
var flag0=0;
$(".setFormal").each(function(){
	
  if(flag0==0){
       $(this).html("设置为普通模板");
        $(this).parent().prev().html("是")
        flag0=1;
    }else{
         $(this).html("设置为常用模板");
        $(this).parent().prev().html("否");
        flag0=0
    }
})
var flag=0;
$(".setFormal").click(function(){
    if(flag==0){
        $(this).html("设置为普通模板");
        $(this).parent().prev().html("是")
        flag=1;
    }else{
         $(this).html("设置为常用模板");
        $(this).parent().prev().html("否");
        flag=0
    }
})
</script>
</body>

</html>